﻿namespace OT.HikiSecureCenterApis.Res
{
    /// <summary>
    /// 基础返回值,仅包含code、msg、 data
    /// </summary>
    public class ResParameter<T>
    {
        /// <summary>
        /// 执行代码 0：成功 其他：失败
        /// https://open.hikvision.com/docs/5a6616f2134e43d1ba338309a8df2387?curNodeId=5a6616f2134e43d1ba338309a8df2387#c3be41a7
        /// </summary>
        public string code { get; set; }
        /// <summary>
        /// 信息
        /// </summary>
        public string msg { get; set; }
        /// <summary>
        /// 返回的数据
        /// </summary>
        public T? data { get; set; }
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool IsSuccess => code == "0";
    }

    public class ResError {
        /// <summary>
        /// 删除结果码，0 – 成功，其他- 失败，参考附录E.1.2 电视墙错误码
        /// https://open.hikvision.com/docs/0f6e8e1e41a14304aeecd287530b9c95?curNodeId=5a6616f2134e43d1ba338309a8df2387#e3f824b2
        /// </summary>
        public int error_code { get; set; }
        /// <summary>
        /// 删除结果信息
        /// </summary>
        public string error_info { get; set; }
    }
}
